import axiosApi from './AxiosApi.js'
const apiList = {
  page: {
    method: 'GET',
    url: `http://localhost:8185/sys/agency/fleet/page`
  },
  truckcount:{
    method: 'GET',
    url: `http://localhost:8185/base/truck/count`
  },
  drivercount:{
    method:'GET',
    url:`http://localhost:8185/sys/driver/count`
  },
  //添加车队
  save:{
    method:'POST',
    url:`http://localhost:8185/sys/agency/fleet`
  }
}
export default {
  //分页查询车队
  queryAll (search) {
    return axiosApi({
      ...apiList.page,
      formData: true,
      data:{
        page:search.page,
        pageSize:search.pageSize,
        name:search.name,
        fleetNumber:search.fleetNumber,
        manager:search.manager
      },
    })
  },
  //车辆总数
  truckCounts(fleetId){
    return axiosApi({
      ...apiList.truckcount,
      formData: true,
      params:{
        fleetId:fleetId
      }
    })
  },
  //司机详情
  driverCounts(fleetId){
    return axiosApi({
      ...apiList.drivercount,
      formData:true,
      params:{
        fleetId:fleetId
      }
    })
  },
  saveFleet(FleetDto){
    return axiosApi({
      ...apiList.save,
      data:FleetDto
    })
  }

}
